<template>
    <div class="container">
        <Header />
        <BackBtn />
        <div class="content">
            <div class="contentBg">
                <div class="title">{{ data.title }}</div>
                <div class="subtitle">
                    <!-- <p>来源：海口市人才工作网</p> -->
                    <p>{{ data.createTime }}</p>
                </div>
                <div class="text" v-html="data.content"></div>
            </div>
        </div>
    </div>
</template>

<script>
import Header from "@/components/Header.vue";
import BackBtn from "@/components/BackBtn";
import moment from "moment";

export default {
    components: {
        BackBtn,
        Header,
    },
    data() {
        return {
            data: {},
        };
    },
    created() {
        console.log(this.$route.params.content);
        if (this.$route.params.content) {
            let data = JSON.parse(this.$route.params.content);
            data.createTime = moment(data.createTime).format(
                "YYYY-MM-DD hh:mm:ss"
            );
            this.data = data;
        }
    },
};
</script>

<style lang="less" scoped>
.container {
    min-height: 100vh;
    background: #f5f6f8;
}

.content {
    padding: 15px 18.5px;
    .contentBg {
        background: #fff;
        border-radius: 10px;
        padding: 0 10px;
        .title {
            padding: 15px 0 10px 0;
            text-align: center;
            font-size: 17px;
            font-weight: bold;
            color: #000000;
        }
        .subtitle {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            p {
                font-size: 13px;
                color: #666666;
            }
        }
        .text {
            padding: 17.5px 0;
            font-size: 14px;
            letter-spacing: 2.5px;
            line-height: 19px;
            color: #000000;
            /deep/img{
                    width: 100%;
                }
        }
    }
}
</style>